﻿using System.Data;

namespace TurtleEngine
{
	 /// <summary>
	 ///
	 /// </summary>
	 public static class ReservedWordsHelper
	 {
		  /// <summary>
		  /// The reserved words
		  /// </summary>
		  private static DataTable reservedWords = new DataTable("ReservedWords");

		  /// <summary>
		  /// Gets the reserved words.
		  /// </summary>
		  /// <value>
		  /// The reserved words.
		  /// </value>
		  public static DataTable ReservedWords
		  {
				get { return reservedWords; }
		  }

		  /// <summary>
		  /// Gets the reserved words.
		  /// </summary>
		  public static void GetReservedWords()
		  {
				reservedWords.Clear();
				reservedWords = Utility.DBConnection.GetSchema("ReservedWords");

				//Utility.PrintDatatable(reservedWords);
		  }

		  /// <summary>
		  /// Writes the reserved words.
		  /// </summary>
		  public static void WriteReservedWords()
		  {
				string xmlfile = reservedWords.TableName + ".xml";
				string xslFile = reservedWords.TableName + ".xsl";
				string htmFile = reservedWords.TableName + ".htm";

				Utility.WriteXML(reservedWords, reservedWords.TableName + ".xml");
				Utility.WriteHTML(xmlfile, xslFile, htmFile);
		  }
	 }
}